package models

type Closure struct {
	Id          int    `xorm:"not null pk autoincr comment('自增主键') INT(11)"`
	FieldId     int    `xorm:"not null comment('训练场id外键关联dts_field中的id') index INT(11)"`
	FieldCode   string `xorm:"default '' comment('围栏编号各驾校可按照自行规则制定') VARCHAR(64)"`
	Description string `xorm:"default '' comment('围栏描述信息') VARCHAR(255)"`
	Type        string `xorm:"default '1' comment('围栏类型，1：外圈，0：内圈') ENUM('0','1')"`
}

func (c *Closure) GetOneClosureByFieldId(id string) (list Closure, err error) {
	_, err = engine.Table("dts_closure").
		Where("field_id = ?", id).
		Get(&list)
	return list, err
}
